package forTesting;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Calendar;

import KeyBoardMap.CorpusIndexer;
import KeyBoardMap.KeyBoard20;

public class TestClass {

	public static void main(String[] args) throws IOException, Exception {

/*		KeyBoard20 qwerty = new KeyBoard20("mapping.properties", "charMap.properties");
		//KeyBoard20 dvorak = new KeyBoard20("mapping.properties", "charMap2.properties");

		BufferedReader input = new BufferedReader(new FileReader("text.txt"));
		StringBuilder contents = new StringBuilder();
		String line = null;
		while ((line = input.readLine()) != null) {
			contents.append(line);
			//contents.append(System.getProperty("line.separator"));
		}
		int a= qwerty.calculate("WelcOME");
		System.out.println(" = "+a);
		input.close();
*/
		/*CorpusIndexer cI = new CorpusIndexer();
		System.out.println("MAIN:");
		System.out.println(cI.loadCorpusDir("corpus"));
		System.out.println(cI);
		cI.getPermutations();
		System.out.println(cI);;*/
		
		CorpusIndexer c = new CorpusIndexer("charMap.properties","corpus");
		c.start();
		long time = System.currentTimeMillis();
		while(c.isAlive())
			Thread.currentThread().sleep(500);
		System.out.println("done");
		System.out.println(((double)(System.currentTimeMillis()-time))/1000);
		time = System.currentTimeMillis();
		System.out.println(c);
		System.out.println(((double)(System.currentTimeMillis()-time))/1000);
		
		
		
		
		
		

	}
}